// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    taskPesCount:0,
    eventCount:0,
    taskCount:0,
  },
  geteventCount(){
    wx.request({
      url: 'http://139.9.169.87:9002/app/Event/getCurrEventCount',
      success:(res)=>{
        this.setData({
          eventCount:res.data
        })
      }
    })
    console.log(this.data.eventCount);
  },
  gettaskCount(){
    wx.request({
      url: 'http://139.9.169.87:9002/app/Task/getCurrTaskCount',
      success:(res)=>{
        this.setData({
          taskCount:res.data
        })
      }
    })
  },

  gettaskPesCount(){
    wx.request({
      url: 'http://139.9.169.87:9002/app/Task/getCurrTaskPerCount',
      success:({data:taskPesCount})=>{
        this.setData({
          taskPesCount
        })
      }
    })
  },
  // 事件处理函数
  onChange(event) {
    console.log(event.detail);
  },
  onLoad(){
    this.geteventCount();
    this.gettaskCount();
    this.gettaskPesCount();
  }
})
